package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.MyAlbumActivity;
import flc.ast.databinding.FragmentPictureBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link PictureFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class PictureFragment extends BaseNoModelFragment<FragmentPictureBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_picture;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);

        mDataBinding.tvPicRotate.setOnClickListener(this);
        mDataBinding.tvPicCrop.setOnClickListener(this);
        mDataBinding.tvPicFilter.setOnClickListener(this);
        mDataBinding.tvPicColorTune.setOnClickListener(this);
        mDataBinding.tvPicRepair.setOnClickListener(this);
        mDataBinding.tvPicText.setOnClickListener(this);
        mDataBinding.tvPicSticker.setOnClickListener(this);
        mDataBinding.tvPicMosaic.setOnClickListener(this);
        mDataBinding.tvFreeSplice.setOnClickListener(this);
        mDataBinding.tvLayoutSplice.setOnClickListener(this);
        mDataBinding.tvVerticalSplice.setOnClickListener(this);
        mDataBinding.tvHorizontalSplice.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.tvPicRotate://旋转
            case R.id.tvPicCrop://裁剪
            case R.id.tvPicFilter://滤镜
            case R.id.tvPicColorTune://色调
            case R.id.tvPicRepair://修复
            case R.id.tvPicText://文字
            case R.id.tvPicSticker://贴纸
            case R.id.tvPicMosaic://马赛克
                MyAlbumActivity.type = 2;
                startActivity(MyAlbumActivity.class);
                break;
            case R.id.tvFreeSplice://自由拼接
                MyAlbumActivity.type = 3;
                startActivity(MyAlbumActivity.class);
                break;
            case R.id.tvLayoutSplice://布局拼接
                MyAlbumActivity.type = 4;
                startActivity(MyAlbumActivity.class);
                break;
            case R.id.tvVerticalSplice://纵向拼接
                MyAlbumActivity.type = 5;
                startActivity(MyAlbumActivity.class);
                break;
            case R.id.tvHorizontalSplice://横向拼接
                MyAlbumActivity.type = 6;
                startActivity(MyAlbumActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}